<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
<%@ include file="RolePowerManager.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <link rel="stylesheet" href="${ctx}/css/common.css" type="text/css"></link>
  <link rel="stylesheet" href="${ctx}/css/reset.css" type="text/css"></link>
  <script type="text/javascript" src="${ctx}/js/jquery-1.7.2.js"></script>
  <script type="text/javascript" src="${ctx}/js/jquery.easydrag.handler.beta2.js"></script>
 <script type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>
  <script type='text/javascript' src='${ctx}/dwr/interface/RewAndPunManager.js'></script>
  <script type="text/javascript" src="${ctx}/js/Dossier/RewamdpunManager.js"></script>
   <script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
  <script type='text/javascript' src='${ctx}/dwr/util.js'></script>

  </head>
  
  <body>
     <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
     </form>	
			<TR height=28>
				<TD background=../images/title_bg1.jpg style="FONT-SIZE: 12px;">
					当前位置:人员档案管理 >> 奖惩管理
				</TD>
			</TR>
			<TR>
				<TD bgColor=#b1ceef height=1></TD>
			</TR>
			<TR height=20>
				<TD background=../images/shadow_bg.jpg></TD>
			</TR>
		</TABLE>
		<form action="${ctx }/GetRewAndPunServlet" method="post" id="searchform" >	
	  <div class="query" >
	  <div class="querytype">
	  	<label>员工名：</label>
		<input class="queryinput" type="text" name="keycode"/>
	  </div>
	  <div class="querytime">
	  	
	  	<div class="selecttime">
	  		<span class="STYLE1"><img src="${ctx}/images/a1.gif" width="9" height="9" /></span>
            <span class="STYLE1"> </span><a href="#"  onclick="search2()" >查询</a><span class="STYLE1"></span>
	  		
	  	</div>
	  </form>
	  	
      </div>
      <div style="float: right; padding-right: 20px">
	  			<span class="STYLE1"><img src="${ctx}/images/001.gif" width="9" height="9" /></span>
            	<span class="STYLE1"> </span><a href="javaScript:popupDiv('add_div')">新增</a><span class="STYLE1"></span>
	  	</div>
	  <div class="clear"></div>
	  </div>
        <div class="bottom" ></div>
        <div id="main">
        <table id="detail_t">
          <tr>
          <th>序号</th>
            <th>标题</th>
            <th>获奖人员</th>
            <th>奖惩类型</th>
            <th>奖惩内容</th>
            <th>奖惩金</th>
            <th>奖惩时间</th>
            <th>更多操作</th>
          </tr>
          
            <c:forEach items="${page.list}" var="t" varStatus="stat">
          <tr class="items">
          	<td >${stat.count}</td>
          	<td id="t_ti">${t.title}</td>
          	<td id="t_em">${t.emp.name}</td>
          	<td id="t_rp">${t.rewAndPunType.type}</td>
          	<td id="t_co">${t.content}</td>
          	<td id="t_mo">${t.money }</td>
          	<td id="t_t">${t.time}</td>
            <td height="18" bgcolor="#FFFFFF">
            <div align="center">
            <span class="STYLE1"><img src="${ctx}/images/037.gif" width="9" height="9" /></span>
            <span class="STYLE1"> [</span><a href="javaScript:clickEditRewAndPun('${t.id}','edit_div')">编辑</a><span class="STYLE1">]</span>
            &nbsp;&nbsp;&nbsp;
            <span class="STYLE2"><img src="${ctx}/images/010.gif" width="9" height="9" /></span>
            <span class="STYLE2"> </span><span class="STYLE1">[</span><a href="javaScript:deleteRewAndPun('${t.id}')">删除</a><span class="STYLE1">]</span>
            </div>
            </td>
           </tr>
           </c:forEach>
         
        </table>
			<div class="manu">共${page.pageCount}条记录当前第<font color="#ff6600">${page.pageNo}/${page.pageCount}</font>页
				<a href="GetRewAndPunServlet?pageNo=${1}">首页</a>
				<a href="GetRewAndPunServlet?pageNo=${page.pageNo-1}">上一页</a>
				<a href="GetRewAndPunServlet?pageNo=${page.pageNo+1}">下一页</a>
				<a href="GetRewAndPunServlet?pageNo=${page.pageCount}">末页 </a>
				每页显示
    	  <input type="text" name="pageSize"  id="pageSize" size="4"/>条
			<input type="submit" value="提交" class="submitbuttton" onclick="changePageSize()"/> 
			</div>
		</div>
 
 <div id="edit_div" class="pop_box">
			<div class="p_head">
				<span class="p_h_title">获奖记录</span> <span><a
					class="p_h_close" onclick="hideDiv('edit_div');" title="close">X</a>
				</span>
			</div>
			<div class="p_box_body" id="p_b_body">
				<div class="p_con">
					<table id="p_con_t">
					  <tr>
					    <td class="t1">员工：<input type="hidden" id="reid"/></td>
					    <td>
					    <span id="empname"></span>
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">标题：</td>
					    <td>
					   
					    <input id="edittitle" type="text"/>
					   
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">获惩罚类型：</td>
					    <td>
					    	<select id="editAndPunType">
					    	</select>
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">获奖内容：</td>
					    <td>
					    
					    <input id="content" type="text"/>
					  
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">奖金：</td>
					    <td>
					    	<input type="text" id="editmoney"/>
					    </td>
					  </tr>					
					  <tr>
					  	<td></td>
					  	<td><input type="button" value="修改" onclick="updateRewAndPun()"/>
					  		
					  	</td>
					  </tr>
					</table>
				</div>
			</div>
		</div>
		<div id="add_div" class="pop_box" style="width:350px">
			<div class="p_head">
				<span class="p_h_title">获奖记录</span> <span><a
					class="p_h_close" onclick="hideDiv('add_div');" title="close">X</a>
				</span>
			</div>
			<div class="p_box_body" id="p_b_body">
				<div class="p_con">
					<table id="p_con_t">
					<tr>
					    <td class="t1">员工号：</td>
					    <td>
					   
					    <input id="empno_add" type="text" onblur="getempname()"/><span id="addempname" style="margin-left: 10px"></span>
					    
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">标题：</td>
					    <td>
					   
					    <input id="title_add" type="text"/>
					    
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">获惩类型：</td>
					    <td>
					    <select id="rewAndPunType_add">
					    		
					    </select> 					   			    
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">获奖内容：</td>
					    <td>					    
					    <input id="content_add" type="text"/>					   
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">奖金：</td>
					    <td>
					 		<input type="text" id="money_add"/>
					    </td>
					  </tr>
					  <tr>
					    <td class="t1">获奖时间：</td>
					    <td>
					    <input id="time_add" type="text" onClick="WdatePicker()"/>
					    </td>
					  </tr>
					
					  <tr>
					  	<td></td>
					  	<td><input type="submit" value="添加" onclick="addRewAndPun()"/>
					  	</td>
					  </tr>
					</table>
				</div>
			</div>
		</div>
</body>
<script type="text/javascript">
function hideDiv(div_id){
            $("#" + div_id).animate({opacity: "hide" }, 300);
}
function popupDiv(div_id) {
            var div_obj = $("#" + div_id);
            //窗口宽度,高度
            var winWidth = $(window).width();
            var winHeight = $(window).height();
            //弹出的div的宽度,高度
            var popHeight = div_obj.height();
            var popWidth = div_obj.width();
            div_obj.animate({
				 opacity: "show", 
				 left: (winWidth-popWidth) / 2, 
				 top: (winHeight-popHeight)/2,
				 width:popWidth,height:popHeight}, 300);
				 
			
}
$(function() {
            $(".pop_box").easydrag();
            $(".pop_box").setHandler(".pop_box .p_head");
            
});
</script>
</html>
